"use strict";
module.exports = {
  /**
   * 新增待办进展
   * @url client/todo/kh/addTodoProcess 前端调用的url参数地址
   * data 请求参数
   * @param {String} params1  参数1
   */
  main: async (event) => {
    let { data = {}, userInfo, util, filterResponse, originalParam } = event;
    let { customUtil, uniID, config, pubFun, vk, db, _, $ } = util;
    let { uid } = data;
    // 业务逻辑开始-----------------------------------------------------------
    if (!data.todo_id) return { code: -1, msg: "待办id不能为空" };
    if (!data.content) return { code: -1, msg: "待办进展内容不能为空" };
    let id = await vk.baseDao.add({
      dbName: "dfb-todo-process", // 表名
      dataJson: {
        todo_id: data.todo_id,
        content: data.content,
      },
    });
    if (!id) return { code: -1, msg: "新增失败" };
    // 业务逻辑结束-----------------------------------------------------------
    return { code: 0, msg: "新增成功" };
  },
};
